<?php
// echo explode(",", "a,b,c,d");

$arr = [1,3,5];
echo implode('=', $arr);// 1=3=5
echo "<br>";
echo join('=', $arr);// 1=3=5
echo "<br>";
echo str_repeat("ab", 3); // ababab
echo "<br>";
echo str_replace("l", "L", "hello");// heLLo
echo "<br>";
echo strpos("abcd", "d"); // 3
echo "<br>";

echo mb_strpos("abc测试", "试");
echo "<br>";
echo mb_strlen("abc测试");
echo "<hr>";

echo strlen("abc"); // 3
echo "<br>";
echo strlen("  hello   ");// 10
echo "<br>";
echo strlen(trim("  hello   "));// 5
echo "<br>";
echo substr("hello", 1); // ello
echo "<br>";
echo substr("hello", 1, 2); // el
echo "<br>";
/*
strtoupper 把字符串转换为大写
lcfirst() 把字符串中的首字符转换为小写
strtolower() 把字符串转换为小写
ucfirst() 把字符串中的首字符转换为大写
ucwords() 把字符串中每个单词的首字符转换为大写
*/
echo "<br>";
// 字符串 也可以被当成数组(一个多字节的数组)
$str = "abcdef";
echo "1=$str[1]";// 取下标为1的字节
echo "<br>";
?>